Masala #0588
Increment decrement
C++ dasturlash tilida increment va decrement amallarini bajarilish tartibini bilsangiz kerak, agar bilmasangiz wikipediadan bilib olishingiz mumkun. Sizga \(X\) o'zgaruvchisiga nisbatan \(N\) marotaba bu ikki amaldan birini qo'llash tartibi beriladi. Sizning vazifangiz \(X\) ning oxirgi natijasini aniqlashdan iborat. Dastlab \(X\) ning qiymati \(0\) ga teng.
Kirish faylining dastlabki satrida \(N(1\leq N\leq 100)\) soni. Keyingi \(N\) ta satrda "X++", "X--", "++X", "--X" lardan biri.
Yagona qatorda masalaning javobini chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
1 ++X |
1 |
2 |
2 X++ --X |
0 |